package telas;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Menu extends JFrame {

	private JPanel contentPane;
	private ConsultaApp consultaApp = new ConsultaApp();
	private ConsultarAparelho consultarAparelho = new ConsultarAparelho();
	private ConsultarDesenvolvedor consultarDesenvolvedor = new ConsultarDesenvolvedor(); 
	private ConsultaUsuario consultaUsuario = new ConsultaUsuario();
	private CadastraDownload cadastraDownload = new CadastraDownload();
 
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Menu frame = new Menu();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Menu() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 358);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnConsultarAparelho = new JButton("Consultar Aparelho");
		btnConsultarAparelho.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				consultarAparelho.setVisible(true);
			}
		});
		btnConsultarAparelho.setBounds(31, 32, 165, 74);
		contentPane.add(btnConsultarAparelho);
		
		JButton btnConsultarApp = new JButton("Consultar App");
		btnConsultarApp.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				consultaApp.setVisible(true);
			}
		});
		btnConsultarApp.setBounds(231, 32, 165, 74);
		contentPane.add(btnConsultarApp);
		
		JButton btnConsultarDesenvolvedor = new JButton("Consultar Desenvolvedor");
		btnConsultarDesenvolvedor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				consultarDesenvolvedor.setVisible(true);
			}
		});
		btnConsultarDesenvolvedor.setBounds(31, 149, 165, 66);
		contentPane.add(btnConsultarDesenvolvedor);
		
		JButton btnConsultarUsuario = new JButton("Consultar Usuario");
		btnConsultarUsuario.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				consultaUsuario.setVisible(true);
			}
		});
		btnConsultarUsuario.setBounds(231, 149, 165, 66);
		contentPane.add(btnConsultarUsuario);
		
		JButton btnFazerDownload = new JButton("Fazer Download");
		btnFazerDownload.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cadastraDownload.AbreTela(1, null);
				cadastraDownload.setVisible(true);
				
				
			}
		});
		btnFazerDownload.setBounds(129, 242, 165, 66);
		contentPane.add(btnFazerDownload);
	}

}
